package com.pajk.user.api;

import net.pocrd.annotation.ApiAutowired;
import net.pocrd.annotation.ApiGroup;
import net.pocrd.annotation.ApiParameter;
import net.pocrd.annotation.DesignedErrorCode;
import net.pocrd.annotation.HttpApi;
import net.pocrd.define.ApiOpenState;
import net.pocrd.define.CommonParameter;
import net.pocrd.define.SecurityType;
import net.pocrd.entity.CallerInfo;

import com.pajk.user.exception.UserServiceHttpCode;
import com.pajk.user.model.User;
import com.pajk.user.model.bo.UserBO;
import com.pajk.user.model.enums.BloodType;
import com.pajk.user.model.enums.CertificationType;
import com.pajk.user.model.enums.Gender;
@ApiGroup(name="user", minCode = 1000000, maxCode = 2000000, codeDefine = UserServiceHttpCode.class)
public interface UserServiceHttpExport {
	
	/**
     * 更新用户信息
     * @param userId
     * @param nick
     * @param gender
     * @param birthday
     */
    @HttpApi(name = "user.updateUserInfo", desc = "更改用户信息", security = SecurityType.UserLogin)
    boolean updateUserInfo(@ApiAutowired(CommonParameter.userId)long userId,
    											@ApiParameter(required = false, name = "nick", desc = "nick")String nick,
    											@ApiParameter(required = false, name = "gender", desc = "性别")Gender gender,
    											@ApiParameter(required = false, name = "birthday", desc = "出生日期")long birthday,
    											@ApiParameter(required = false, name = "height", desc = "身高cm")int height,
    											@ApiParameter(required = false, name = "weight", desc = "体重")int weight);
    
    /**
     * 更改用户手机号
     *
     * 约定：手机号一旦设定，必须符合唯一性约束
     *
     * @param userId 更改手机号用户ID
     *
     */
    @HttpApi(name = "user.updateMobile", desc = "更改用户手机号", security = SecurityType.UserLogin)
    public boolean updateMobile(@ApiAutowired(CommonParameter.userId) long userId, @ApiParameter(required = true, name = "mobile", desc = "用户手机号，格式参考：13926583227")long mobile);
    
    /**
     * 绑定万里通帐号
     *
     * @param userId 用户Id
     * @param wltAccountId 万里通帐号Id
     *
     */
    @HttpApi(name = "user.bindWltAccount", desc = "绑定万里通帐号", security = SecurityType.Integrated, state = ApiOpenState.INTEGRATION)
    @DesignedErrorCode({UserServiceHttpCode.C_WANLIID_BINDED_TO_DIFFERENT_USER,UserServiceHttpCode.C_USER_NOT_FOUND})
    public boolean bindWltAccount(@ApiParameter(required = true, name = "userId", desc = "用户id")long userId, @ApiParameter(required = true, name = "wltAccountId", desc = "万里通帐号Id")String wltAccountId);
    
    @HttpApi(name = "user.getUserInfo", desc = "获取用户详细信息", security = SecurityType.UserLogin)
    public UserBO getUserInfo(@ApiAutowired(CommonParameter.userId) long userId);
    
    @HttpApi(name = "user.mergeUser", desc = "用户替换合并", security = SecurityType.UserLogin)
    public boolean mergeUser(@ApiParameter(required = true, name = "oldUserId", desc = "原用户id")long oldUserId, @ApiParameter(required = true, name = "newUserId", desc = "新用户id")long newUserId);
    
    
}
